<div class="list-container">
<div class="row m-0 list-header">
   <div class="col-10 p-0">
      <h2>Payment</h2>
   </div>
   <div class="col-2 p-0 float-right text-right">
      <%= link( raw("<i class='fas fa-plus'></i> Add a method"), to: payment_method_path(@conn, :new),
         class: "btn btn-primary float-right")%>
   </div>
</div>
<div class="row m-0 list">
  <table class="table table-hover table-responsive-lg">
    <thead>
        <tr>
          <th>Payment Method Name</th>
          <th>Active</th>
          <th></th>
        </tr>
    </thead>
    <%= for payment_method <- @payment_methods do %>
      <tbody>
        <tr>
          <td><%=payment_method.name%></td>
          <td><%=payment_method.active?%></td>
          <td>
            <div class="dropdown col-12 p-0 float-right options-container">
               <a class="p-2 dropdown-toggle options" href="#" role="button"  data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
               <i class="fa fa-cog"></i>
               </a>
                <div class="dropdown-menu dropdown-menu-right">
                  <%= link("Edit", to: payment_method_path(@conn, :edit, payment_method.id),
                     class: "dropdown-item")
                     %>
                  <div class="dropdown-divider"></div>
                  <%= link("Delete", to: payment_method_path(@conn, :delete, payment_method.id),
                     method: :delete, data: [confirm: "Are you sure you want to delete?"],
                     class: "dropdown-item")
                     %>
                </div>
            </div>
          </td>
        </tr>
      </tbody>
    <% end %>
  </table>     
</div>
